this.view = {extend: 'iframe'}

this.handler = function(){
	
	var user = request.attr("user"),
		requestAnchorForm = forms.requestAnchor();
	
	this.get = function(){
		
		$("body").html("<h3>Requesting \"" + request.params.s + "\" as an in-text link...</h3>");
		requestAnchorForm.errorMessage && $("body").append('<p class=error>' + requestAnchorForm.errorMessage + '</p>');
		$("body").append(requestAnchorForm.html());
		$("label").after("<span class='info'>Enter the url to the website you wish to link to.</span><br />")
	
	}
	
	this.post = function(){
		requestAnchorForm.pass ?
			 $.ajax({
	      url: request.params.href,
	      async: false,
	      complete: function(xhr){
	      
	        request.attr("xhr", xhr.responseXML);
	        request.forward("/iframe/anchor-preview", request.params);
	      }
	    }) :
	    this.get();
		
		
		  
		
		/*
		
		* 
		* var anchor = {
		  url: request.params.u,
		  str: request.params.s,
		  pos: parseInt(request.params.p, 10),
		};
		actions.previewAnchorProcess(previewAnchorForm, user, anchor);
		(previewAnchorForm.pass)
			? (function(){
				response.write('<script>window.parent.AutoHref.makeAnchors(' + [anchor].toSource() + ');</script>');
			})()
			: this.get();
	  */
	}	
	
}